
function streamPublishApp(msg,name,hrefTitle, hrefLink, userPrompt)
{
    FB.ui(
    {
        method: 'stream.publish',
        message: msg,
        display: 'dialog',
        attachment: {
            name: '<?= FACEBOOK_APP_NAME ?>',
            caption: '',
            description: ('Play the Panasonic Cooking Magic Online-Game! There are 50 Panasonic Cooking Magic kitchen appliances and Master Chef Limited Edition T-shirt up for grabs! Just memorize the product images’ position on the grid within 10 seconds, once the product images shuffled, participants are given 30 seconds to drag and drop each one into its original location. It\'s so easy! What are you waiting for?'),
            href: hrefLink,
              
            media: [{
                type: 'image',
                src: 'http://www.dcinnovation.net/icons/share_icon.jpg',
                href:hrefLink
            }]
        },
        action_links: [
        {
            text: hrefTitle, 
            href: '<?= FACEBOOK_PAGE_TAB_URL ?>'
        }
        ],
        user_prompt_message: userPrompt
    },
    function(response) {
        if (response && response.post_id){
            $.ajax({
                type: "post",
                url: 'update_share.php',
                data: "uid=<?= $_SESSION['fb_id'] ?>&share_msg="+msg+"&share_type=fb_app",
                success: function(data) {  
                    $('#divMsg').html(data);
                }
            });
                    
        }
      
    }
    );
}
    

function share_twitter(content,vid){
    window.open('http://twitter.com/home?status='+content,'<?= FACEBOOK_APP_NAME ?>','status=0,width=620,height=350,top=0,left=0');
    setTimeout("updateTweeterShare('"+content+"','"+vid+"')",1000);	  
}
      
      
function updateTweeterShare(content,vid)
{
    $.ajax({
        type: "post",
        url: "update_share.php",
        data: "uid=<?= $_SESSION['fb_id'] ?>&share_msg="+content+"&video_id="+vid+"&share_type=tw_app",
        success: function(data) {  
            $('#divMsg').html(data);
        }
    });
}
      
function increaseIframeSize(w,h){
          
    var obj =   new Object;
    obj.width=w;
    obj.height=h;
    FB.Canvas.setSize(obj);
}
